﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StorePressAdd.aspx.cs" Inherits="Admin_store_StoreAdd" ValidateRequest="false" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>50CMS后台框架</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.css?v=4.1.0" rel="stylesheet">
    <link href="../css/plugins/iCheck/custom.css" rel="stylesheet">


    <script src="../../js/jquery1.9.1.js"></script>
    <script type="text/javascript" src="../../js/jquery.form.js"></script>
    <script src="../js/bootstrap.min.js?v=3.3.6"></script>

    <script src="../50/webuploader.min.js"></script>
    <script src="../50/webUpload.js"></script>

    <link href="../50/imgup.css" rel="stylesheet" />
    <link href="../50/style.css" rel="stylesheet" />
    <script src="../50/function.js"></script>

   

    <style type="text/css">
        #where, #lonlat, #lonlat2, #txtAddress {
            width: 300px;
            height: 30px;
            font-size: 24px;
            /*color: blue;*/
        }

        #but {
            width: 100px;
            height: 36px;
            font-size: 20px;
        }


        .layui-layer-content {
            width: 800px !important;
            height: 600px !important;
        }

            .layui-layer-content img {
                height: 100%;
            }
    </style>
</head>
<body class="gray-bg">
    <form id="form1" runat="server" class="form-horizontal m-t">
        <div class="wrapper animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">

                    <div class="tabs-container" style="margin-top: 1em;">
                        <%--<ul class="nav nav-tabs">
                            <li class="active" id="tab1"><a data-toggle="tab" href="#tab11" aria-expanded="true">基础信息</a> </li>
                            <li class="" id="tab2"><a data-toggle="tab" href="#tab44" aria-expanded="false">扩展信息</a> </li>
                        </ul>--%>

                        <div class="tab-content">
                            <div id="tab11" class="tab-pane active">
                                <div class="panel-body">
                                    <div class="form-group">
                                        <div class="col-sm-12" style="margin-top: 1em;">
                                            <label class="col-sm-2 control-label">服务网点名称：</label>
                                            <div class="col-sm-6">
                                                <asp:TextBox ID="txtSname" runat="server" type="text" class="form-control" required=""
                                                    aria-required="true" HintTitle="门店名称" HintInfo="请输入门店名称"></asp:TextBox>
                                            </div>
                                        </div>

                                        <div class="col-sm-12" style="margin-top: 1em;">
                                            <label class="col-sm-2 control-label">联系电话：</label>
                                            <div class="col-sm-6">
                                                <asp:TextBox ID="txtStel" runat="server" type="text" class="form-control" required=""
                                                    aria-required="true" HintTitle="联系电话" HintInfo="请输入店铺联系电话"></asp:TextBox>
                                            </div>
                                        </div>

                                        <div class="col-sm-12" style="margin-top: 1em;">
                                            <label class="col-sm-2 control-label">id：</label>
                                            <div class="col-sm-6">
                                                <asp:TextBox ID="apicode" runat="server" type="text" class="form-control" required=""
                                                    aria-required="true" HintTitle="" HintInfo=""></asp:TextBox>
                                            </div>
                                        </div>

                                        <div class="col-sm-12" style="margin-top: 1em;">
                                            <label class="col-sm-2 control-label">营业时间：</label>
                                            <div class="col-sm-3">
                                                <asp:TextBox ID="txtSstime" runat="server" CssClass="laydate-icon form-control layer-date"></asp:TextBox>
                                            </div>
                                            <div style="height: 1px;">至</div>
                                            <div class="col-sm-3">
                                                <asp:TextBox ID="txtSetime" runat="server" CssClass="laydate-icon form-control layer-date"></asp:TextBox>
                                            </div>
                                        </div>

                                        <div class="col-sm-12" style="margin-top: 1em;">
                                            <label class="col-sm-2 control-label">网点图片：</label>
                                            <div class="col-sm-10">
                                                <ul class="upload-ul clearfix">
                                                    <li class="upload-pick">
                                                        <div class="webuploader-container clearfix" id="goodsUpload" style="background: none;"></div>
                                                    </li>
                                                </ul>
                                                <input type="text" id="xsimg" runat="server" value="" style="display: none;" />
                                            </div>
                                        </div>

                                        <div class="col-sm-12" style="margin-top: 1em;">
                                            <label class="col-sm-2 control-label">店铺简介：</label>
                                            <div class="col-sm-6">
                                                <asp:TextBox ID="txtSintroduce" runat="server" HintTitle="请输入店铺简介" class="form-control" HintInfo="店铺简介" TextMode="MultiLine" Height="330px" Width="800px"></asp:TextBox>
                                            </div>
                                        </div>



                                        <div class="col-sm-12" style="margin-top: 1em;">
                                            <label class="col-sm-2 control-label">
                                                详细地址：
                                            </label>
                                            <div class="col-sm-10">
                                                <div style="margin: auto; width: 70%; height: 400px; border: 2px solid gray; margin-bottom: 50px; float: left;" id="container">
                                                </div>
                                                <div style="position: absolute; top: 0; right: 0px; width: 30%; text-align: left;">
                                                    <h3 style="color: red;">介绍：输入地点然后点击“地图查找”搜索，<br />
                                                        再点击地图地点获取相应经纬度</h3>
                                                    输入地点

				                         <input id="where" runat="server" name="where" type="text" placeholder="请输入地址" /><input id="but" type="button" value="地图查找" onclick="sear(document.getElementById('where').value);" />

                                                    <br />
                                                    <br />
                                                    地址：<asp:TextBox ID="txtAddress" runat="server" required="" aria-required="true" HintTitle="地址" HintInfo="请填写地址"></asp:TextBox>

                                                    <br />
                                                    <br />
                                                    经度：<input id="lonlat" runat="server" />
                                                    <br />
                                                    <br />
                                                    纬度：<input id="lonlat2" runat="server" />
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group" style="margin-top: 2em;">
                                            <div class="col-sm-8 col-sm-offset-3" style="margin-top: 2em;">
                                                <asp:Button ID="Button1" runat="server" Text="确定" class="btn btn-primary" OnClick="Button1_Click" />
                                            </div>
                                        </div>

                                    </div>
                                </div>
                            </div>

                            <div id="tab22" class="tab-pane active" style="display: none">
                                <div class="panel-body">
                                    <div class="ibox-content">
                                        <asp:Literal ID="ltMasterSetting" runat="server"></asp:Literal>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <!-- 全局js -->

    <!-- 全局js -->
    <!-- iCheck -->
    <script src="../js/plugins/iCheck/icheck.min.js"></script>
    <script>
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green'

            });
        });
    </script>
    <!-- 自定js -->


    <script>

        function setValue() {
            var myimg = "|";
            var myimgTxt = "|";
            $(".upload-ul").find('li').each(function () {
                if (typeof ($(this).attr("mya")) != "undefined")
                    myimg += $(this).attr("mya") + "|";

                if (typeof ($(this).attr("title")) != "undefined")
                    myimgTxt += $(this).attr("title") + "|";
            });

            $("#xsimg").val(myimg);
            $("#myimgTxt").val(myimgTxt);
        }

        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green'

            });
        });

        $(function () {
            var myimg = "|";
            //上传图片
            var $tgaUpload = $('#goodsUpload').diyUpload({
                url: '../50/imgup.ashx',
                success: function (data) {

                    myimg += data.id + "|";
                    $("#xsimg").val(myimg);


                },
                error: function (err) { },
                auto: true,
                buttonText: '',
                accept: {
                    title: "Images",
                    extensions: 'gif,jpg,jpeg,bmp,png',
                    mimeTypes: 'image/*'
                },
                thumb: {
                    width: 120,
                    height: 90,
                    quality: 100,
                    allowMagnify: true,
                    crop: true,
                    type: "image/jpeg"
                },
                picList: '<%=imgArr%>'
            });
        });
    </script>

    <script type="text/javascript" src="../js/layer/layer.js"></script>
     <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=E4805d16520de693a3fe707cdc962045&s=1"></script>
    <script type="text/javascript" charset="utf-8" src="http://map.qq.com/api/js?v=2.exp&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77&libraries=convertor"></script>
    <script type="text/javascript">

        var map = new BMap.Map("container");
        map.setDefaultCursor("crosshair");

        map.enableScrollWheelZoom();
        var point = new BMap.Point(102.720652,25.044309);
        map.centerAndZoom(point, 13);
        var gc = new BMap.Geocoder();

        map.addControl(new BMap.NavigationControl());
        map.addControl(new BMap.OverviewMapControl());
        map.addControl(new BMap.ScaleControl());
        map.addControl(new BMap.MapTypeControl());
        map.addControl(new BMap.CopyrightControl());

        var marker = new BMap.Marker(point);
        map.addOverlay(marker);

        marker.addEventListener("click", function (e) {
            //转换百度坐标为腾讯坐标LatLng(纬度,经度)
            qq.maps.convertor.translate(new qq.maps.LatLng(e.point.lat, e.point.lng), 3, function (res) {
                latlng = res[0];
                console.log(latlng);
                document.getElementById("lonlat").value = latlng.lng;
                document.getElementById("lonlat2").value = latlng.lat;
            });
            gc.getLocation(e.point, function (rs) {
                //console.log(rs.address); //地址描述(string)
                //console.log(rs.addressComponents);//结构化的地址描述(object)
                //console.log(rs.addressComponents.province); //省
                //console.log(rs.addressComponents.city); //城市
                //console.log(rs.addressComponents.district); //区县
                //console.log(rs.addressComponents.street); //街道
                //console.log(rs.addressComponents.streetNumber); //门牌号
                //console.log(rs.surroundingPois); //附近的POI点(array)
                //console.log(rs.surroundingPois[0].address); //附近的POI点(array)
                //console.log(rs.business); //商圈字段，代表此点所属的商圈(string)
                document.getElementById("txtAddress").value = rs.surroundingPois[0].address;
            });
        });


        marker.enableDragging();

        marker.addEventListener("dragend", function (e) {
            gc.getLocation(e.point, function (rs) {
                showLocationInfo(e.point, rs);
            });
        });


        function showLocationInfo(pt, rs) {
            var opts = { width: 250, height: 150, title: "当前位置" };
            var addComp = rs.addressComponents;
            var addr = "当前位置：" + addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber + "<br/>";
            addr += "纬度: " + pt.lat + ", " + "经度：" + pt.lng;
            var infoWindow = new BMap.InfoWindow(addr, opts);
            marker.openInfoWindow(infoWindow);
        }

        map.addEventListener("click", function (e) {
            qq.maps.convertor.translate(new qq.maps.LatLng(e.point.lat, e.point.lng), 3, function (res) {
                latlng = res[0];
                console.log(latlng);
                document.getElementById("lonlat").value = latlng.lng;
                document.getElementById("lonlat2").value = latlng.lat;
            });
            gc.getLocation(e.point, function (rs) {
                //console.log(rs.address); //地址描述(string)
                //console.log(rs.addressComponents);//结构化的地址描述(object)
                //console.log(rs.addressComponents.province); //省
                //console.log(rs.addressComponents.city); //城市
                //console.log(rs.addressComponents.district); //区县
                //console.log(rs.addressComponents.street); //街道
                //console.log(rs.addressComponents.streetNumber); //门牌号
                //console.log(rs.surroundingPois); //附近的POI点(array)
                //console.log(rs.surroundingPois[0].address); //附近的POI点(array)
                //console.log(rs.business); //商圈字段，代表此点所属的商圈(string)
                document.getElementById("txtAddress").value = rs.surroundingPois[0].address;
            });
        });


        var traffic = new BMap.TrafficLayer();
        map.addTileLayer(traffic);


        function iploac(result) {
            var cityName = result.name;
        }

        var myCity = new BMap.LocalCity();
        myCity.get(iploac);

        function sear(result) {
            var local = new BMap.LocalSearch(map, { renderOptions: { map: map } });
            local.search(result);
        }

    </script>

    <!-- 自定js -->
    <script type="text/javascript" src="../js/layer/layer.js"></script>
    <script type="text/javascript">
        if (typeof (Close) != "undefined") {
            layer.msg('保存成功，正在返回', {
                time: 2000, //20s后自动关闭 
            }, function () {
                var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
                parent.layer.close(index); //执行关闭
            });
        }

        $(function () {
            var myimg = "|";
            //上传图片
            var $tgaUpload = $('#goodsUpload').diyUpload({
                url: '../50/imgup.ashx',
                success: function (data) {

                    myimg += data.id + "|";
                    $("#xsimg").val(myimg);

                },
                error: function (err) { },
                auto: true,
                buttonText: '',
                accept: {
                    title: "Images",
                    extensions: 'gif,jpg,jpeg,bmp,png',
                    mimeTypes: 'image/*'
                },
                thumb: {
                    width: 120,
                    height: 90,
                    quality: 100,
                    allowMagnify: true,
                    crop: true,
                    type: "image/jpeg"
                },
                picList: "<%=imgArr%>"
            });
        });

        //页面层-图片
        //layer.open({
        //    type: 1,
        //    title: false,
        //    closeBtn: 0,
        //    area: ['auto'],
        //    skin: 'layui-layer-nobg', //没有背景色
        //    shadeClose: true,
        //    content: $('#tong')
        //});
    </script>
    <script src="../Js/laydate/laydate.js"></script>
    <script type="text/javascript">
        laydate.render({
            elem: '#txtSstime'
            , type: 'time'
        });
        laydate.render({
            elem: '#txtSetime'
            , type: 'time'
        });
    </script>
</body>
</html>
